package 蓝桥真题;

import java.util.Scanner;

public class 时间显示 {
       static Scanner sc=new Scanner(System.in);
       
       public static void main(String[]args)throws Exception{
    	      long t=sc.nextLong();
    	      long unit=24*60*60*1000;
    	      t=t%unit;
    	      unit/=24;
    	      long hh=t/unit;
    	      t=t-hh*unit;
    	      unit/=60;
    	      long mm=t/unit;
    	      t=t-unit*mm;
    	      unit/=60;
    	      long ss=t/unit;
    	      String time="";
    	      if(hh<=9)time=time+"0"+hh;
    	      else time=time+hh;
    	      time=time+":";
    	      if(mm<=9)time=time+"0"+mm;
    	      else time=time+mm;
    	      time=time+":";
    	      if(ss<=9)time=time+"0"+ss;
    	      else time=time+ss;
    	      System.out.print(time);
       }
}
